﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Water.Web.Controls.BaseInterface;
using Water.Web.Controls.Util;

namespace demo.Pages
{
    public partial class LeftMenuUpdate : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            
        }
        protected override void OnPreRender(EventArgs e)
        {
            base.OnPreRender(e);

            if (this.Container1.CurrentMode == ContainerMode.Item)
                Utils.FindControlEx("edit", this.Container1).Visible = true;
            else
                Utils.FindControlEx("edit", this.Container1).Visible = false;

            if (this.Container1.CurrentMode == ContainerMode.Edit)
                Utils.FindControlEx("update", this.Container1).Visible = true;
            else
                Utils.FindControlEx("update", this.Container1).Visible = false;

            if (this.Container1.CurrentMode == ContainerMode.Item)
                Utils.FindControlEx("new", this.Container1).Visible = true;
            else
                Utils.FindControlEx("new", this.Container1).Visible = false;

            if (this.Container1.CurrentMode == ContainerMode.Insert)
                Utils.FindControlEx("insert", this.Container1).Visible = true;
            else
                Utils.FindControlEx("insert", this.Container1).Visible = false;

            if (this.Container1.CurrentMode != ContainerMode.Insert)
                Utils.FindControlEx("delete", this.Container1).Visible = true;
            else
                Utils.FindControlEx("delete", this.Container1).Visible = false;

            if (this.Container1.CurrentMode == ContainerMode.Item)
                Utils.FindControlEx("cancel", this.Container1).Visible = false;
            else
                Utils.FindControlEx("cancel", this.Container1).Visible = true;

        }
    }
}
